package friend

import (
  "github.com/emicklei/go-restful"
)

func (f FriendList) Register(container *restful.Container) {
  ws := new(restful.WebService)
  ws.Path("/friend").
    Consumes(restful.MIME_XML, restful.MIME_JSON).
    Produces(restful.MIME_JSON, restful.MIME_XML)

  ws.Route(ws.POST("/add").To(f.AddFriend))
  ws.Route(ws.POST("/del").To(f.DelFriend))
  ws.Route(ws.GET("/list/{mySn}").To(f.FindFriend))
  container.Add(ws)
}

